package com.unitd.base.frame.exception;

import com.unitd.base.frame.enums.ResultEnum;
import lombok.Data;

/**
 * 自定义的异常信息类, 用于按照自定义规则抛出异常信息
 * @filename LogisticsException.java
 * @copyright www.unitd.com
 * @author hudan
 * @version 1.0
 * @date 2019-01-25
 */
@Data
public class LogisticsException extends RuntimeException {

	/** 错误代码 */
	private Integer code;

	public LogisticsException(ResultEnum resultEnum) {
		super(resultEnum.getMessage());

		this.code = resultEnum.getCode();
	}

	public LogisticsException(ResultEnum resultEnum, String messasge) {
		super(messasge);

		this.code = resultEnum.getCode();
	}

	public LogisticsException(Integer code, String message) {
		super(message);
		this.code = code;
	}
}
